package com.sinosoft.tcmneim.controller;

import com.sinosoft.tcmneim.dataObject.TblMedicalIncexpen;
import com.sinosoft.tcmneim.dataObject.TblMedicalIncome;
import com.sinosoft.tcmneim.service.TblMedicalIncomeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 医疗机构收支及人员收入情况
 * 本机构人员收入情况Controller
 * @author bjc
 * @date 2021-09-15
 */
@Controller
@RequestMapping("/tblMedicalIncome")
public class TblMedicalIncomeController {

    @Autowired
    TblMedicalIncomeService tblMedicalIncomeService;

    /**
     * 查询本机构人员收入情况
     */
    @GetMapping("/list")
    @ResponseBody
    public List<TblMedicalIncome> list(){
        List<TblMedicalIncome>list=tblMedicalIncomeService.list();
        return list ;
    }

    /**
     * 根据ID查询本机构人员收入情况
     */
    @GetMapping("/selectByItemCode/{itemCode}")
    @ResponseBody
    public Object selectByItemCode(@PathVariable("itemCode")String itemCode){
        return tblMedicalIncomeService.selectByItemCode(itemCode);
    }

    /**
     * 新增本机构人员收入情况
     */
    @PostMapping("/save")
    public int save(TblMedicalIncome tblMedicalIncome){
        return tblMedicalIncomeService.insert(tblMedicalIncome);
    }

    /**
     * 修改本机构人员收入情况
     */
    @PostMapping("/updated")
    public int updated(TblMedicalIncome tblMedicalIncome){
        return tblMedicalIncomeService.updated(tblMedicalIncome);
    }
    /**
     * 删除本机构人员收入情况
     */
    @PostMapping( "/remove")
    public int remove(String  itemCode)
    {
        return tblMedicalIncomeService.deleteByItemCode(itemCode);
    }
}
